package cn.wbnyua.resume.mvc.mapper;

import cn.wbnyua.resume.mvc.domain.Course;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface CourseMapper {

    @Select("select * from course")
    List<Course> findAll();

    @Select("select * from course where id = #{id}")
    Course findById(Long id);
    @Insert("INSERT INTO `myself`.`course` (`name`) VALUES (#{name})")
    int add(Course course);

    @Update("UPDATE `myself`.`course` SET `name` = #{name} WHERE `id` = #{id}")
    int update(Course course);

    @Delete("delete from course where id = #{id}")
    int remove(Long id);

}
